package main

import (
	"encoding/json"
	"fmt"
)

func main() {
	type Currency int
	const (
		USD Currency = iota // 美元
		EUR                 // 欤元
		GBP                 // 英镑
		RMB                 // 人民币
	)
	symbol := [...]string{USD: "$", EUR: "€", GBP: "£", RMB: "¥"}
	fmt.Println(RMB, symbol[RMB]) // "3 ¥"

	ints := make([]int, 10)
	fmt.Println(ints[0])
	var a Point
	a.X = 1
	bytes, _ := json.Marshal(a)
	fmt.Printf("%s", bytes)

	var ac = aaa
	var acc = aaa
	fmt.Println(ac(1) == acc(1))
	fmt.Println(ac(1))
	fmt.Println((bbb(1, 2, 3)))
}

func aaa(n int) int {
	return n
}
func bbb(o ...int) int {
	total := 0
	for _, v := range o {
		total += v
	}
	return total
}

type Point struct {
	X, Y int
}
type Circle struct {
	Point
	Radius int
}
